package com.sskj.qiangjin.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.qiangjin.http.HttpConfig;
import com.sskj.qiangjin.ui.activity.ExchangeActivity;

/**
 * Created by Q-Kang on 2019/1/22.
 */

public class ExchangePresenter extends BasePresenter<ExchangeActivity> {


    public void getExchange() {
        httpService.getExchange()
                .tag(this)
                .execute(new JsonCallBack<HttpData>(this) {
                    @Override
                    public void onSuccess(Response<HttpData> response) {
                        HttpData httpData = response.body();
//                        ToastUtil.showShort(httpData.msg);
                        if (httpData.getStatus() == HttpConfig.OK) {
                            mView.updataExchange((String) httpData.getData());
                        }
                    }
                });
    }


}
